﻿@using ALinq.BBS.App_GlobalResources
@using ALinq.BBS
@using ALinq.BBS.Models
@model ALinq.BBS.DataAccess.PostList
@{
    PageData["Title"] = Label.Favorites;
    PageData["Css"] = "PostFavor.css";
    Layout = "_Layout.cshtml";
    var postList = Model;

    Func<int, string> createUrl = delegate(int pageIndex)
    {
        return this.CreatePostFavorPageUrl(pageIndex);
    };

    var pagingModel = new PagingModel(postList, createUrl);
}
<table cellpadding="0" cellspacing="0" style="width: 100%">
    <tr style="height: 20px;">
        <td class="postListHeader" style="width: 30px;">
            &nbsp;
        </td>
        <td class="postListHeader" style="width: 30px;">
            &nbsp;
        </td>
        <td class="postListHeader">
            标题
        </td>
        <td class="postListHeader" style="width: 120px">
            所属论坛
        </td>
        <td class="postListHeader" style="width: 120px;">
            作者
        </td>
        <td class="postListHeader" style="width: 30px;">
            回复
        </td>
        <td class="postListHeader" style="width: 30px;">
            阅读
        </td>
        <td class="postListHeader" style="width: 120px;">
            发表时间
        </td>
    </tr>
    @foreach (var post in postList)
    {
       
        <tr class="postListItem">
            <td>
                <input type="checkbox" name="postID" value="@post.ID" />
            </td>
            <td>
                @*<kolo:PostTypeIcon ID="PostTypeIcon" runat="server" Post="<%#Container.DataItem %>" />*@
            </td>
            <td style="text-align: left;">
                @if (post != null)
                {
                    @this.CreatePostPageLink(post)
                }
                else
                {
                    <span>该帖子已被删除。</span>
                }
            </td>
            <td>
                @post.Forum.Name
            </td>
            <td>
                @post.UserName
            </td>
            <td>
                @post.Replies.Count
            </td>
            <td>
                @post.HitCount
            </td>
            <td>
                @post.Date.ToString("yyyy-MM-dd")
            </td>
        </tr>
    }
</table>
@RenderPage("../Shared/Controls/PagingBar.cshtml", pagingModel)
@if (postList.Count() > 0)
{
    <div class="" style="text-align: left;">
        <input type="button" style="width: 60px;" value="@Label.SelectAll" onclick="selectAll(this.form)" />
        <input type="button" style="width: 60px;" value="@Label.UnSelect" onclick="unselect(this.form)" />
        <input type="button" style="width: 60px;" value="@Label.Delete" onclick="remove(this.form)" />
    </div>
}
